package com.ymk.service.impl;

import com.ymk.base.mybatis.DaoRouter;
import com.ymk.base.mybatis.Pagination;
import com.ymk.bo.orders.OrdersBO;
import com.ymk.service.IOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
/**
 * <p>
 * 订单表 服务实现类
 * </p>
 *
 * @author 莫参商
 * @since 2023-05-05
 */
@Service
public class OrdersService implements IOrdersService {

    @Override
    public OrdersBO get(Map param) {
    return this.daoRouter.queryForObject("Orders.loadOrders",param);
    }

    @Override
    public List<OrdersBO> list(Map param) {
        return this.daoRouter.query("Orders.loadOrders",param);
    }

    @Override
    public List<OrdersBO> listForPage(Pagination pagination) {
        return this.daoRouter.query("Orders.loadOrdersForPage",pagination);
    }

    @Override
    public void post(OrdersBO param) {
        this.daoRouter.insert("AOrders.insertOrders",param);
    }

    @Override
    public void update(OrdersBO param) {
        this.daoRouter.update("AOrders.updateOrders",param);
    }

    @Override
    public void del(OrdersBO param) {
        this.daoRouter.update("AOrders.delOrders",param);
    }

    @Autowired
    private DaoRouter daoRouter;

}
